<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Navigation_BreadcrumbsRenderer extends Core_View_Helper_Navigation_Abstract
{
    protected $_attribs = array(
        'linkLast'          => false,
        'maxDepth'          => 1,
        'minDepth'          => 1,
        'separator'         => ' &gt; ',
    );
    protected $_booleanValues = array('linkLast');

    public function breadcrumbsRenderer($parentId = 0, $attribs = array())
    {
        if (!Zend_Registry::isRegistered('Zend_Navigation')) {
            // needed to register Navigation into Zend_Registry
            $menu = new Core_Menu($parentId);
        }
        $this->_setAttribs($attribs);

        // render partial
        if ($this->_issetPartial($attribs)) {
            return $this->view->navigation()->breadcrumbs()->renderPartial(null, $attribs['partial']);
        }
        // render breadcrumbs
        return $this->view->navigation()->breadcrumbs()
            ->setLinkLast($this->_getAttrib('linkLast'))
            ->setMaxDepth($this->_getAttrib('maxDepth'))
            ->setMinDepth($this->_getAttrib('minDepth'))
            ->setSeparator($this->_getAttrib('separator'))
            ->render();
    }
}